﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.Rendering.PlatformKeywordSet
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using UnityEngine.Scripting;

#nullable disable
namespace UnityEngine.Rendering
{
  /// <summary>
  ///   <para>A collection of Rendering.ShaderKeyword that represents a specific platform variant.</para>
  /// </summary>
  [UsedByNativeCode]
  public struct PlatformKeywordSet
  {
    private const int k_SizeInBits = 64;
    internal ulong m_Bits;

    private ulong ComputeKeywordMask(BuiltinShaderDefine define)
    {
      return (ulong) (1 << (int) define % 64);
    }

    /// <summary>
    ///   <para>Check whether a specific shader keyword is enabled.</para>
    /// </summary>
    /// <param name="define"></param>
    public bool IsEnabled(BuiltinShaderDefine define)
    {
      return (this.m_Bits & this.ComputeKeywordMask(define)) > 0UL;
    }

    public void Enable(BuiltinShaderDefine define)
    {
      this.m_Bits |= this.ComputeKeywordMask(define);
    }

    public void Disable(BuiltinShaderDefine define)
    {
      this.m_Bits &= ~this.ComputeKeywordMask(define);
    }
  }
}
